$(function () {
    $("#auditory-save").click(auditoryMerge);
    $('#auditory-modal').modal('show');

});

//
function auditoryMerge() {
    var saveBtn = 'auditory-save';
    disabledById(saveBtn);
    var childId = $("#childId").val();
    var value = $("#value").val();
    var code = $("#code").val();
    var abilityId = $("#abilityId").val();
    var scheduleId = $("#scheduleId").val();

    var data = {
        childId: childId,
        value: value,
        code: code,
        abilityId: abilityId,
        scheduleId:scheduleId
    };
    $.ajax({
        url: basePath + "teacher/auditoryMerge",
        type: "post",
        data: data,
        success: function (data) {
            if (data.result == true) {
                window.location.reload();
                $("#auditory-modal").modal('hide');
            } else {
                alert("保存失败" + (data.msg ? "：" + data.msg : "！"));
            }
            removeDisabled(saveBtn);
        }
    });

}





